<?php
class LinkTypeModel extends ModelBase
{
	protected static $_tableName = 'linktypes';
	public static function add($name)
	{
		$data = array(
			'name'	=> $name,
		);
		return self::queryInsert(self::$_tableName, $data);
	}
	
	public static function getList()
	{
		return self::querySelect(self::$_tableName, array('*'));
	}
	
	public static function get($tid)
	{
		return self::querySelectSingle(self::$_tableName, array('*'), "id=$tid");
	}
	
	public static function update($tid, $data)
	{
		return self::queryUpdate(self::$_tableName, $data, "id=$tid");
	}
	
	public static function delete($tid)
	{
		return self::queryDelete(self::$_tableName, "id={$tid}");
	}
}